//
//  kqyTabBarViewController.m
//  百思不得姐os1
//
//  Created by kqy on 8/1/16.
//  Copyright © 2016 kqy. All rights reserved.
//

#import "kqyTabBarViewController.h"
#import "kqy1essentialViewController.h"
#import "kqy2newViewController.h"
#import "kqy3noticeViewController.h"    
#import "kqy4meViewController.h"
#import "kqyNavViewController.h"
#import "kqyTabBar.h"

@interface kqyTabBarViewController ()

@end

@implementation kqyTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupChildViewController];
}
- (void) setupChildViewController {
//    kqy1essentialViewController *kqy1essentialVC = [[kqyNavViewController alloc] initWithRootViewController:[[kqy1essentialViewController alloc] init]];
//    [self addChildViewController:kqy1essentialVC];
//    
//    kqy2newViewController *kqy2newVC = [[kqyNavViewController alloc] initWithRootViewController:[[kqy2newViewController alloc] init]];
//    [self addChildViewController:kqy2newVC];
//    
//    kqy3noticeViewController *kqy3noticeVC = [[kqyNavViewController alloc] initWithRootViewController:[[kqy3noticeViewController alloc] init]];
//    [self addChildViewController:kqy3noticeVC];
//    
//    kqy4meViewController *kqy4meVC = [[kqyNavViewController alloc] initWithRootViewController:[[kqy4meViewController alloc] init]];
////    [self addChildViewController:kqy4meVC];
//
    [self setupChildVc:[[kqyNavViewController alloc] initWithRootViewController:[[kqy4meViewController alloc] init]] andTitle:@"4me" andImage:@"tabBar_me_icon" andSelectedImg:@"tabBar_me_click_icon"];
    [self setupChildVc:[[kqyNavViewController alloc] initWithRootViewController:[[kqy1essentialViewController alloc] init]] andTitle:@"1ess" andImage:@"tabBar_essence_icon" andSelectedImg:@"tabBar_essence_click_icon"];
    [self setupChildVc:[[kqyNavViewController alloc] initWithRootViewController:[[kqy2newViewController alloc] init]] andTitle:@"2new" andImage:@"tabBar_new_icon" andSelectedImg:@"tabBar_new_click_icon"];
    [self setupChildVc:[[kqyNavViewController alloc] initWithRootViewController:[[kqy3noticeViewController alloc] init]] andTitle:@"3notice" andImage:@"tabBar_friendTrends_icon" andSelectedImg:@"tabBar_friendTrends_click_icon"];
    
    [self setValue:[[kqyTabBar alloc] init] forKey:@"tabBar"];
}
- (void) setupChildVc:(UIViewController *)childVc andTitle:(NSString *)title andImage:(NSString *)image andSelectedImg:(NSString *)selectedImage {
    childVc.tabBarItem.title = title;
    if (image.length > 0) {
    childVc.tabBarItem.image = [UIImage imageNamed:image];
    childVc.tabBarItem.selectedImage = [UIImage imageNamed:selectedImage];
        
    }
    [self addChildViewController:childVc];
}






@end
